<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Layer</title>
<base target="class-frame">
<link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
<script src="../assets/js/paper.js"></script>
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/codemirror.js"></script>
<script src="../assets/js/docs.js"></script>
</head>
<body class="reference">
<div class="reference-class">
<h1>Layer</h1>

<p> Extends <b><a href="../classes/Item.html"><tt>Item</tt></a></b>, <b><a href="../classes/Group.html"><tt>Group</tt></a></b></p>

<p>The Layer item represents a layer in a Paper.js project.</p>
<p>The layer which is currently active can be accessed through
<a href="../classes/Project.html#activelayer"><tt>project.activeLayer</tt></a>.</p>
<p>An array of all layers in a project can be accessed through
<a href="../classes/Project.html#layers"><tt>project.layers</tt></a>.</p>

</div>

<!-- ============================== constructors ========================= -->
<div class="reference-members"><h2>Constructors</h2>
	
		
<div id="layer" class="member">
<div class="member-link">
<a name="layer" href="#layer"><tt><b>Layer</b>([children])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
<p>Creates a new Layer item and places it at the end of the
<a href="../classes/Project.html#layers"><tt>project.layers</tt></a> array. The newly created layer will be activated,
so all newly created items will be placed within it.</p>

<ul><b>Parameters:</b>

<li>
<tt>children:</tt> 
Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
&mdash;&nbsp;An array of items that will be added to the
newly created layer.
&mdash;&nbsp;optional
</li>

</ul>


<p>
<b>Example</b> 
</p>


<pre class="code">var layer = new Layer();</pre>


</div>
</div>
</div>
	
		
<div id="layer-object" class="member">
<div class="member-link">
<a name="layer-object" href="#layer-object"><tt><b>Layer</b>(object)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
<p>Creates a new Layer item and places it at the end of the
<a href="../classes/Project.html#layers"><tt>project.layers</tt></a> array. The newly created layer will be activated,
so all newly created items will be placed within it.</p>

<ul><b>Parameters:</b>

<li>
<tt>object:</tt> 
<tt>Object</tt>
&mdash;&nbsp;an object literal containing the properties to be
set on the layer.

</li>

</ul>


<p>
<b>Example</b> 
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-0">
var path = new Path([100, 100], [100, 200]);
var path2 = new Path([50, 150], [150, 150]);

// Create a layer. The properties in the object literal
// are set on the newly created layer.
var layer = new Layer({
    children: [path, path2],
    strokeColor: 'black',
    position: view.center
});
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
</div>



</div>
</div>
</div>
	
</div>







<!-- ============================== methods ================================ -->
	<div class="reference-members"><h2>Methods</h2>
		
			
<div id="activate" class="member">
<div class="member-link">
<a name="activate" href="#activate"><tt><b>activate</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Activates the layer.</p>
	
	
	
	<p>
<b>Example</b> 
</p>


<pre class="code">var firstLayer = project.activeLayer;
var secondLayer = new Layer();
console.log(project.activeLayer == secondLayer); // true
firstLayer.activate();
console.log(project.activeLayer == firstLayer); // true</pre>

</div>
</div>
</div>
		
	</div>




<!-- =========================== inherited properties ====================== -->
<div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>

	
<div id="id" class="member">
<div class="member-link">
<a name="id" href="#id"><tt><b>id</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The unique id of the item.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="classname" class="member">
<div class="member-link">
<a name="classname" href="#classname"><tt><b>className</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The class name of the item as a string.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>String('Group', 'Layer', 'Path', 'CompoundPath', 'Shape',
'Raster', 'PlacedSymbol', 'PointText')</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="name" class="member">
<div class="member-link">
<a name="name" href="#name"><tt><b>name</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The name of the item. If the item has a name, it can be accessed by name
through its parent's children list.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>String</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> 
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-1">
var path = new Path.Circle({
    center: [80, 50],
    radius: 35
});
// Set the name of the path:
path.name = 'example';

// Create a group and add path to it as a child:
var group = new Group();
group.addChild(path);

// The path can be accessed by name:
group.children['example'].fillColor = 'red';
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="style" class="member">
<div class="member-link">
<a name="style" href="#style"><tt><b>style</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The path style of the item.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Style.html"><tt>Style</tt></a>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Applying several styles to an item in one go, by passing an object to its style property:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-2">
var circle = new Path.Circle({
    center: [80, 50],
    radius: 30
});
circle.style = {
    fillColor: 'blue',
    strokeColor: 'red',
    strokeWidth: 5
};
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Copying the style of another item:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-3">
var path = new Path.Circle({
    center: [50, 50],
    radius: 30,
    fillColor: 'red'
});

var path2 = new Path.Circle({
    center: new Point(180, 50),
    radius: 20
});

// Copy the path style of path:
path2.style = path.style;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Applying the same style object to multiple items:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-4">
var myStyle = {
    fillColor: 'red',
    strokeColor: 'blue',
    strokeWidth: 4
};

var path = new Path.Circle({
    center: [50, 50],
    radius: 30
});
path.style = myStyle;

var path2 = new Path.Circle({
    center: new Point(150, 50),
    radius: 20
});
path2.style = myStyle;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="visible" class="member">
<div class="member-link">
<a name="visible" href="#visible"><tt><b>visible</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the item is visible. When set to <tt>false</tt>, the
item won't be drawn.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>true</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Hiding an item:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-5">
var path = new Path.Circle({
    center: [50, 50],
    radius: 20,
    fillColor: 'red'
});

// Hide the path:
path.visible = false;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="blendmode" class="member">
<div class="member-link">
<a name="blendmode" href="#blendmode"><tt><b>blendMode</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The blend mode with which the item is composited onto the canvas. Both
the standard canvas compositing modes, as well as the new CSS blend modes
are supported. If blend-modes cannot be rendered natively, they are
emulated. Be aware that emulation can have an impact on performance.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>'normal'</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>String('normal', 'multiply', 'screen', 'overlay', 'soft-light',
'hard-light', 'color-dodge', 'color-burn', 'darken', 'lighten',
'difference', 'exclusion', 'hue', 'saturation', 'luminosity', 'color',
'add', 'subtract', 'average', 'pin-light', 'negation', 'source-over',
'source-in', 'source-out', 'source-atop', 'destination-over',
'destination-in', 'destination-out', 'destination-atop', 'lighter',
'darker', 'copy', 'xor')</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Setting an item's blend mode:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-6">
// Create a white rectangle in the background
// with the same dimensions as the view:
var background = new Path.Rectangle(view.bounds);
background.fillColor = 'white';

var circle = new Path.Circle({
    center: [80, 50],
    radius: 35,
    fillColor: 'red'
});

var circle2 = new Path.Circle({
    center: new Point(120, 50),
    radius: 35,
    fillColor: 'blue'
});

// Set the blend mode of circle2:
circle2.blendMode = 'multiply';
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="opacity" class="member">
<div class="member-link">
<a name="opacity" href="#opacity"><tt><b>opacity</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The opacity of the item as a value between <tt>0</tt> and <tt>1</tt>.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>1</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Making an item 50% transparent:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-7">
var circle = new Path.Circle({
    center: [80, 50],
    radius: 35,
    fillColor: 'red'
});

var circle2 = new Path.Circle({
    center: new Point(120, 50),
    radius: 35,
    fillColor: 'blue',
    strokeColor: 'green',
    strokeWidth: 10
});

// Make circle2 50% transparent:
circle2.opacity = 0.5;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="selected" class="member">
<div class="member-link">
<a name="selected" href="#selected"><tt><b>selected</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the item is selected. This will also return
<tt>true</tt> for <a href="../classes/Group.html"><tt>Group</tt></a> items if they are partially selected, e.g.</p>
<p>groups containing selected or partially selected paths.</p>
<p>Paper.js draws the visual outlines of selected items on top of your
project. This can be useful for debugging, as it allows you to see the
construction of paths, position of path curves, individual segment points
and bounding boxes of symbol and raster items.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	<p><b>See also:</b>
	<tt><a href="../classes/Project.html#selecteditems"><tt>project.selectedItems</tt></a></tt>, <tt><a href="../classes/Segment.html#selected"><tt>segment.selected</tt></a></tt>, <tt><a href="../classes/Curve.html#selected"><tt>curve.selected</tt></a></tt>, <tt><a href="../classes/Point.html#selected"><tt>point.selected</tt></a></tt>
	</p>

	<p>
<b>Example</b> &mdash; Selecting an item:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-8">
var path = new Path.Circle({
    center: [80, 50],
    radius: 35
});
path.selected = true; // Select the path
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="clipmask" class="member">
<div class="member-link">
<a name="clipmask" href="#clipmask"><tt><b>clipMask</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the item defines a clip mask. This can only be set on
paths, compound paths, and text frame objects, and only if the item is
already contained within a clipping group.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="data" class="member">
<div class="member-link">
<a name="data" href="#data"><tt><b>data</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>A plain javascript object which can be used to store
arbitrary data on the item.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Object</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> 
</p>


<pre class="code">var path = new Path();
path.data.remember = 'milk';</pre>

<p>
<b>Example</b> 
</p>


<pre class="code">var path = new Path();
path.data.malcolm = new Point(20, 30);
console.log(path.data.malcolm.x); // 20</pre>

<p>
<b>Example</b> 
</p>


<pre class="code">var path = new Path();
path.data = {
    home: 'Omicron Theta',
    found: 2338,
    pets: ['Spot']
};
console.log(path.data.pets.length); // 1</pre>

<p>
<b>Example</b> 
</p>


<pre class="code">var path = new Path({
    data: {
        home: 'Omicron Theta',
        found: 2338,
        pets: ['Spot']
    }
});
console.log(path.data.pets.length); // 1</pre>

</div>

</div>
</div>

	
	<h3>Position and Bounding Boxes</h3>

<div id="position-_dontLink" class="member">
<div class="member-link">
<a name="position-_dontLink" href="#position-_dontLink"><tt><b>position</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The item's position within the parent item's coordinate system. By
default, this is the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the item's
<a href="../classes/Item.html#bounds" onclick="return toggleMember('bounds', true);"><tt>bounds</tt></a> rectangle.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Point.html"><tt>Point</tt></a>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Changing the position of a path:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-9">
// Create a circle at position { x: 10, y: 10 }
var circle = new Path.Circle({
    center: new Point(10, 10),
    radius: 10,
    fillColor: 'red'
});

// Move the circle to { x: 20, y: 20 }
circle.position = new Point(20, 20);

// Move the circle 100 points to the right and 50 points down
circle.position += new Point(100, 50);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Changing the x coordinate of an item's position:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-10">
// Create a circle at position { x: 20, y: 20 }
var circle = new Path.Circle({
    center: new Point(20, 20),
    radius: 10,
    fillColor: 'red'
});

// Move the circle 100 points to the right
circle.position.x += 100;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="pivot-_dontLink" class="member">
<div class="member-link">
<a name="pivot-_dontLink" href="#pivot-_dontLink"><tt><b>pivot</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The item's pivot point specified in the item coordinate system, defining
the point around which all transformations are hinging. This is also the
reference point for <a href="../classes/Item.html#position" onclick="return toggleMember('position', true);"><tt>position</tt></a>. By default, it is set to
<tt>null</tt>, meaning the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the item's
<a href="../classes/Item.html#bounds" onclick="return toggleMember('bounds', true);"><tt>bounds</tt></a> rectangle is used as pivot.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Point.html"><tt>Point</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="bounds" class="member">
<div class="member-link">
<a name="bounds" href="#bounds"><tt><b>bounds</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The bounding rectangle of the item excluding stroke width.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="strokebounds" class="member">
<div class="member-link">
<a name="strokebounds" href="#strokebounds"><tt><b>strokeBounds</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The bounding rectangle of the item including stroke width.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="handlebounds" class="member">
<div class="member-link">
<a name="handlebounds" href="#handlebounds"><tt><b>handleBounds</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The bounding rectangle of the item including handles.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="rotation" class="member">
<div class="member-link">
<a name="rotation" href="#rotation"><tt><b>rotation</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The current rotation angle of the item, as described by its
<a href="../classes/Item.html#matrix" onclick="return toggleMember('matrix', true);"><tt>matrix</tt></a>.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="scaling" class="member">
<div class="member-link">
<a name="scaling" href="#scaling"><tt><b>scaling</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The current scale factor of the item, as described by its
<a href="../classes/Item.html#matrix" onclick="return toggleMember('matrix', true);"><tt>matrix</tt></a>.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Point.html"><tt>Point</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="matrix" class="member">
<div class="member-link">
<a name="matrix" href="#matrix"><tt><b>matrix</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The item's transformation matrix, defining position and dimensions in
relation to its parent item in which it is contained.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Matrix.html"><tt>Matrix</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="globalmatrix-_dontClone" class="member">
<div class="member-link">
<a name="globalmatrix-_dontClone" href="#globalmatrix-_dontClone"><tt><b>globalMatrix</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The item's global transformation matrix in relation to the global project
coordinate space. Note that the view's transformations resulting from
zooming and panning are not factored in.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Matrix.html"><tt>Matrix</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="applymatrix" class="member">
<div class="member-link">
<a name="applymatrix" href="#applymatrix"><tt><b>applyMatrix</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the group applies transformations directly to its
children, or whether they are to be stored in its <a href="../classes/Item.html#matrix" onclick="return toggleMember('matrix', true);"><tt>matrix</tt></a></p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="transformcontent" class="member">
<div class="member-link">
<a name="transformcontent" href="#transformcontent"><tt><b>transformContent</b></tt></a>
</div>
<div class="member-description hidden">

</div>
</div>

	
	<h3>Project Hierarchy</h3>

<div id="project" class="member">
<div class="member-link">
<a name="project" href="#project"><tt><b>project</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The project that this item belongs to.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Project.html"><tt>Project</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="view" class="member">
<div class="member-link">
<a name="view" href="#view"><tt><b>view</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The view that this item belongs to.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/View.html"><tt>View</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="layer" class="member">
<div class="member-link">
<a name="layer" href="#layer"><tt><b>layer</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The layer that this item is contained within.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Layer.html"><tt>Layer</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="parent" class="member">
<div class="member-link">
<a name="parent" href="#parent"><tt><b>parent</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The item that this item is contained within.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Item.html"><tt>Item</tt></a>
	</li>
	</ul>
	
	<p>
<b>Example</b> 
</p>


<pre class="code">var path = new Path();

// New items are placed in the active layer:
console.log(path.parent == project.activeLayer); // true

var group = new Group();
group.addChild(path);

// Now the parent of the path has become the group:
console.log(path.parent == group); // true</pre>

<p>
<b>Example</b> &mdash; Setting the parent of the item to another item
</p>


<pre class="code">var path = new Path();

// New items are placed in the active layer:
console.log(path.parent == project.activeLayer); // true

var group = new Group();
group.parent = path;

// Now the parent of the path has become the group:
console.log(path.parent == group); // true

// The path is now contained in the children list of group:
console.log(group.children[0] == path); // true</pre>

<p>
<b>Example</b> &mdash; Setting the parent of an item in the constructor
</p>


<pre class="code">var group = new Group();

var path = new Path({
    parent: group
});

// The parent of the path is the group:
console.log(path.parent == group); // true

// The path is contained in the children list of group:
console.log(group.children[0] == path); // true</pre>

</div>

</div>
</div>

	
<div id="children" class="member">
<div class="member-link">
<a name="children" href="#children"><tt><b>children</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The children items contained within this item. Items that define a
<a href="../classes/Item.html#name" onclick="return toggleMember('name', true);"><tt>name</tt></a> can also be accessed by name.</p>
<p><b>Please note:</b> The children array should not be modified directly
using array functions. To remove single items from the children list, use
<a href="../classes/Item.html#remove"><tt>item.remove</tt></a>(), to remove all items from the children list, use
<a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>(). To add items to the children list, use
<a href="../classes/Item.html#addchild-item"><tt>item.addChild(item)</tt></a> or <a href="../classes/Item.html#insertchild-index-item"><tt>item.insertChild(index, item)</tt></a>.</p>
	
	
	<ul><b>Type:</b>
	<li>
		Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Accessing items in the children array:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-11">
var path = new Path.Circle({
    center: [80, 50],
    radius: 35
});

// Create a group and move the path into it:
var group = new Group();
group.addChild(path);

// Access the path through the group's children array:
group.children[0].fillColor = 'red';
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Accessing children by name:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-12">
var path = new Path.Circle({
    center: [80, 50],
    radius: 35
});
// Set the name of the path:
path.name = 'example';

// Create a group and move the path into it:
var group = new Group();
group.addChild(path);

// The path can be accessed by name:
group.children['example'].fillColor = 'orange';
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Passing an array of items to item.children:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-13">
var path = new Path.Circle({
    center: [80, 50],
    radius: 35
});

var group = new Group();
group.children = [path];

// The path is the first child of the group:
group.firstChild.fillColor = 'green';
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="firstchild" class="member">
<div class="member-link">
<a name="firstchild" href="#firstchild"><tt><b>firstChild</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The first item contained within this item. This is a shortcut for
accessing <tt>item.children[0]</tt>.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Item.html"><tt>Item</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="lastchild" class="member">
<div class="member-link">
<a name="lastchild" href="#lastchild"><tt><b>lastChild</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The last item contained within this item.This is a shortcut for
accessing <tt>item.children[item.children.length - 1]</tt>.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Item.html"><tt>Item</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="nextsibling" class="member">
<div class="member-link">
<a name="nextsibling" href="#nextsibling"><tt><b>nextSibling</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The next item on the same level as this item.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Item.html"><tt>Item</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="previoussibling" class="member">
<div class="member-link">
<a name="previoussibling" href="#previoussibling"><tt><b>previousSibling</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The previous item on the same level as this item.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Item.html"><tt>Item</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="index" class="member">
<div class="member-link">
<a name="index" href="#index"><tt><b>index</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The index of this item within the list of its parent's children.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
	<h3>Stroke Style</h3>

<div id="strokecolor" class="member">
<div class="member-link">
<a name="strokecolor" href="#strokecolor"><tt><b>strokeColor</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The color of the stroke.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Color.html"><tt>Color</tt></a>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Setting the stroke color of a path:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-14">
// Create a circle shaped path at { x: 80, y: 50 }
// with a radius of 35:
var circle = new Path.Circle({
    center: [80, 50],
    radius: 35
});

// Set its stroke color to RGB red:
circle.strokeColor = new Color(1, 0, 0);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="strokewidth" class="member">
<div class="member-link">
<a name="strokewidth" href="#strokewidth"><tt><b>strokeWidth</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The width of the stroke.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Setting an item's stroke width:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-15">
// Create a circle shaped path at { x: 80, y: 50 }
// with a radius of 35:
var circle = new Path.Circle({
    center: [80, 50],
    radius: 35,
    strokeColor: 'red'
});

// Set its stroke width to 10:
circle.strokeWidth = 10;
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="strokecap" class="member">
<div class="member-link">
<a name="strokecap" href="#strokecap"><tt><b>strokeCap</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The shape to be used at the beginning and end of open <a href="../classes/Path.html"><tt>Path</tt></a> items,
when they have a stroke.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>'butt'</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>String('round', 'square', 'butt')</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; A look at the different stroke caps:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-16">
var line = new Path({
    segments: [[80, 50], [420, 50]],
    strokeColor: 'black',
    strokeWidth: 20,
    selected: true
});

// Set the stroke cap of the line to be round:
line.strokeCap = 'round';

// Copy the path and set its stroke cap to be square:
var line2 = line.clone();
line2.position.y += 50;
line2.strokeCap = 'square';

// Make another copy and set its stroke cap to be butt:
var line2 = line.clone();
line2.position.y += 100;
line2.strokeCap = 'butt';
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-16"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="strokejoin" class="member">
<div class="member-link">
<a name="strokejoin" href="#strokejoin"><tt><b>strokeJoin</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The shape to be used at the segments and corners of <a href="../classes/Path.html"><tt>Path</tt></a> items
when they have a stroke.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>'miter'</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>String('miter', 'round', 'bevel')</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; A look at the different stroke joins:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-17">
var path = new Path({
    segments: [[80, 100], [120, 40], [160, 100]],
    strokeColor: 'black',
    strokeWidth: 20,
    // Select the path, in order to see where the stroke is formed:
    selected: true
});

var path2 = path.clone();
path2.position.x += path2.bounds.width * 1.5;
path2.strokeJoin = 'round';

var path3 = path2.clone();
path3.position.x += path3.bounds.width * 1.5;
path3.strokeJoin = 'bevel';
</script>
<div class="canvas"><canvas width="516" height="120" id="canvas-17"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="dashoffset" class="member">
<div class="member-link">
<a name="dashoffset" href="#dashoffset"><tt><b>dashOffset</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The dash offset of the stroke.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>0</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="strokescaling" class="member">
<div class="member-link">
<a name="strokescaling" href="#strokescaling"><tt><b>strokeScaling</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the stroke is to be drawn taking the current affine
transformation into account (the default behavior), or whether it should
appear as a non-scaling stroke.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>true</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="dasharray" class="member">
<div class="member-link">
<a name="dasharray" href="#dasharray"><tt><b>dashArray</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies an array containing the dash and gap lengths of the stroke.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>[]</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Array</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> 
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-18">
var path = new Path.Circle({
    center: [80, 50],
    radius: 40,
    strokeWidth: 2,
    strokeColor: 'black'
});

// Set the dashed stroke to [10pt dash, 4pt gap]:
path.dashArray = [10, 4];
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="miterlimit" class="member">
<div class="member-link">
<a name="miterlimit" href="#miterlimit"><tt><b>miterLimit</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The miter limit of the stroke.</p>
<p>When two line segments meet at a sharp angle and miter joins have been
specified for <a href="../classes/Item.html#strokejoin"><tt>item.strokeJoin</tt></a>, it is possible for the miter to
extend far beyond the <a href="../classes/Item.html#strokewidth"><tt>item.strokeWidth</tt></a> of the path. The
miterLimit imposes a limit on the ratio of the miter length to the
<a href="../classes/Item.html#strokewidth"><tt>item.strokeWidth</tt></a>.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>10</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="windingrule" class="member">
<div class="member-link">
<a name="windingrule" href="#windingrule"><tt><b>windingRule</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The winding-rule with which the shape gets filled. Please note that only
modern browsers support winding-rules other than <tt>'nonzero'</tt>.</p>
	
	
		<ul><b>Default:</b>
		<li>
		<tt>'nonzero'</tt>
		</li>
		</ul>
	
	<ul><b>Type:</b>
	<li>
		<tt>String('nonzero', 'evenodd')</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
	<h3>Fill Style</h3>

<div id="fillcolor" class="member">
<div class="member-link">
<a name="fillcolor" href="#fillcolor"><tt><b>fillColor</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The fill color of the item.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Color.html"><tt>Color</tt></a>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Setting the fill color of a path to red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-19">
// Create a circle shaped path at { x: 80, y: 50 }
// with a radius of 35:
var circle = new Path.Circle({
    center: [80, 50],
    radius: 35
});

// Set the fill color of the circle to RGB red:
circle.fillColor = new Color(1, 0, 0);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
</div>


</div>

</div>
</div>

	
	<h3>Selection Style</h3>

<div id="selectedcolor" class="member">
<div class="member-link">
<a name="selectedcolor" href="#selectedcolor"><tt><b>selectedColor</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The color the item is highlighted with when selected. If the item does
not specify its own color, the color defined by its layer is used instead.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Color.html"><tt>Color</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
	<h3>Event Handlers</h3>

<div id="onframe" class="member">
<div class="member-link">
<a name="onframe" href="#onframe"><tt><b>onFrame</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Item level handler function to be called on each frame of an animation.</p>
<p>The function receives an event object which contains information about
the frame event:</p>
<p><b><tt>event.count</tt></b>: the number of times the frame event was
fired.</p>
<p><b><tt>event.time</tt></b>: the total amount of time passed since the
first frame event in seconds.</p>
<p><b><tt>event.delta</tt></b>: the time passed in seconds since the last
frame event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p><b>See also:</b>
	<tt><a href="../classes/View.html#onframe"><tt>view.onFrame</tt></a></tt>
	</p>

	<p>
<b>Example</b> &mdash; Creating an animation:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-20">
// Create a rectangle shaped path with its top left point at:
// {x: 50, y: 25} and a size of {width: 50, height: 50}
var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
path.fillColor = 'black';

path.onFrame = function(event) {
    // Every frame, rotate the path by 3 degrees:
    this.rotate(3);
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onmousedown" class="member">
<div class="member-link">
<a name="onmousedown" href="#onmousedown"><tt><b>onMouseDown</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse button is pushed down on the
item. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains
information about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Press the mouse button down on the circle shaped path, to make it red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-21">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse is pressed on the item,
// set its fill color to red:
path.onMouseDown = function(event) {
    this.fillColor = 'red';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Press the mouse on the circle shaped paths to remove them:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-22">
// Loop 30 times:
for (var i = 0; i < 30; i++) {
    // Create a circle shaped path at a random position
    // in the view:
    var path = new Path.Circle({
        center: Point.random() * view.size,
        radius: 25,
        fillColor: 'black',
        strokeColor: 'white'
    });

    // When the mouse is pressed on the item, remove it:
    path.onMouseDown = function(event) {
        this.remove();
    }
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onmouseup" class="member">
<div class="member-link">
<a name="onmouseup" href="#onmouseup"><tt><b>onMouseUp</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse button is released over the item.</p>
<p>The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains
information about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Release the mouse button over the circle shaped path, to make it red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-23">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse is released over the item,
// set its fill color to red:
path.onMouseUp = function(event) {
    this.fillColor = 'red';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onclick" class="member">
<div class="member-link">
<a name="onclick" href="#onclick"><tt><b>onClick</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse clicks on the item. The function
receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the
mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Click on the circle shaped path, to make it red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-24">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse is clicked on the item,
// set its fill color to red:
path.onClick = function(event) {
    this.fillColor = 'red';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Click on the circle shaped paths to remove them:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-25">
// Loop 30 times:
for (var i = 0; i < 30; i++) {
    // Create a circle shaped path at a random position
    // in the view:
    var path = new Path.Circle({
        center: Point.random() * view.size,
        radius: 25,
        fillColor: 'black',
        strokeColor: 'white'
    });

    // When the mouse clicks on the item, remove it:
    path.onClick = function(event) {
        this.remove();
    }
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="ondoubleclick" class="member">
<div class="member-link">
<a name="ondoubleclick" href="#ondoubleclick"><tt><b>onDoubleClick</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse double clicks on the item. The
function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information
about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Double click on the circle shaped path, to make it red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-26">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse is double clicked on the item,
// set its fill color to red:
path.onDoubleClick = function(event) {
    this.fillColor = 'red';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Double click on the circle shaped paths to remove them:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-27">
// Loop 30 times:
for (var i = 0; i < 30; i++) {
    // Create a circle shaped path at a random position
    // in the view:
    var path = new Path.Circle({
        center: Point.random() * view.size,
        radius: 25,
        fillColor: 'black',
        strokeColor: 'white'
    });

    // When the mouse is double clicked on the item, remove it:
    path.onDoubleClick = function(event) {
        this.remove();
    }
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onmousemove" class="member">
<div class="member-link">
<a name="onmousemove" href="#onmousemove"><tt><b>onMouseMove</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called repeatedly when the mouse moves on top of the
item. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains
information about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Move over the circle shaped path, to change its opacity:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-28">
// Create a circle shaped path at the center of the view:
    var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
    });

// When the mouse moves on top of the item, set its opacity
// to a random value between 0 and 1:
path.onMouseMove = function(event) {
    this.opacity = Math.random();
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onmouseenter" class="member">
<div class="member-link">
<a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse moves over the item. This
function will only be called again, once the mouse moved outside of the
item first. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which
contains information about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-29">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse enters the item, set its fill color to red:
path.onMouseEnter = function(event) {
    this.fillColor = 'red';
}

// When the mouse leaves the item, set its fill color to black:
path.onMouseLeave = function(event) {
    this.fillColor = 'black';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-30">
function enter(event) {
    this.fillColor = 'red';
}

function leave(event) {
    this.fillColor = 'black';
}

// When the mouse is pressed:
function onMouseDown(event) {
    // Create a circle shaped path at the position of the mouse:
    var path = new Path.Circle(event.point, 25);
    path.fillColor = 'black';

    // When the mouse enters the item, set its fill color to red:
    path.onMouseEnter = enter;

    // When the mouse leaves the item, set its fill color to black:
    path.onMouseLeave = leave;
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="onmouseleave" class="member">
<div class="member-link">
<a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The function to be called when the mouse moves out of the item.</p>
<p>The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains
information about the mouse event.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Function</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> &mdash; Move the mouse over the circle shaped path and then move it out of it again to set its fill color to red:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-31">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse leaves the item, set its fill color to red:
path.onMouseLeave = function(event) {
    this.fillColor = 'red';
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
</div>


</div>

</div>
</div>

	
<div id="tangent" class="member">
<div class="member-link">
<a name="tangent" href="#tangent"><tt><b>tangent</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The tangential vector to the <tt>#curve</tt> at the given location.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Point.html"><tt>Point</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="normal" class="member">
<div class="member-link">
<a name="normal" href="#normal"><tt><b>normal</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The normal vector to the <tt>#curve</tt> at the given location.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<a href="../classes/Point.html"><tt>Point</tt></a>
	</li>
	</ul>
	
	
</div>

</div>
</div>

	
<div id="curvature" class="member">
<div class="member-link">
<a name="curvature" href="#curvature"><tt><b>curvature</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>The curvature of the <tt>#curve</tt> at the given location.</p>
	
		<p>Read only.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Number</tt>
	</li>
	</ul>
	
	
</div>

</div>
</div>

</div>


<!-- =========================== inherited methods ========================= -->
<div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>

	
<div id="set-props" class="member">
<div class="member-link">
<a name="set-props" href="#set-props"><tt><b>set</b>(props)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Sets those properties of the passed object literal on this item to
the values defined in the object literal, if the item has property of the
given name (or a setter defined for it).</p>
	
<ul><b>Parameters:</b>

<li>
<tt>props:</tt> 
<tt>Object</tt>


</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the item itself.
</li>
	
	</ul>

	
	<p>
<b>Example</b> &mdash; Setting properties through an object literal
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-32">
var circle = new Path.Circle({
    center: [80, 50],
    radius: 35
});

circle.set({
    strokeColor: 'red',
    strokeWidth: 10,
    fillColor: 'black',
    selected: true
});
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="clone" class="member">
<div class="member-link">
<a name="clone" href="#clone"><tt><b>clone</b>([insert])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Clones the item within the same project and places the copy above the
item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>insert:</tt> 
<tt>Boolean</tt>
&mdash;&nbsp;specifies whether the copy should be
inserted into the DOM. When set to <tt>true</tt>, it is inserted above the
original.
&mdash;&nbsp;optional, default: <tt>true</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the newly cloned item
</li>
	
	</ul>

	
	<p>
<b>Example</b> &mdash; Cloning items:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-33">
var circle = new Path.Circle({
    center: [50, 50],
    radius: 10,
    fillColor: 'red'
});

// Make 20 copies of the circle:
for (var i = 0; i < 20; i++) {
    var copy = circle.clone();

    // Distribute the copies horizontally, so we can see them:
    copy.position.x += i * copy.bounds.width;
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="copyto-item" class="member">
<div class="member-link">
<a name="copyto-item" href="#copyto-item"><tt><b>copyTo</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>When passed a project, copies the item to the project,
or duplicates it within the same project. When passed an item,
copies the item into the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Project.html"><tt>Project</tt></a> / <a href="../classes/Layer.html"><tt>Layer</tt></a> / <a href="../classes/Group.html"><tt>Group</tt></a> / <a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a>
&mdash;&nbsp;the item or project to
copy the item to

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the new copy of the item
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="rasterize" class="member">
<div class="member-link">
<a name="rasterize" href="#rasterize"><tt><b>rasterize</b>([resolution])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Rasterizes the item into a newly created Raster object. The item itself
is not removed after rasterization.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>resolution:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the resolution of the raster
in pixels per inch (DPI). If not specified, the value of
<tt>view.resolution</tt> is used.
&mdash;&nbsp;optional, default: <tt>view.resolution</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Raster.html"><tt>Raster</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created raster item
</li>
	
	</ul>

	
	<p>
<b>Example</b> &mdash; Rasterizing an item:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-34">
var circle = new Path.Circle({
    center: [50, 50],
    radius: 5,
    fillColor: 'red'
});

// Create a rasterized version of the path:
var raster = circle.rasterize();

// Move it 100pt to the right:
raster.position.x += 100;

// Scale the path and the raster by 300%, so we can compare them:
circle.scale(5);
raster.scale(5);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="contains-point" class="member">
<div class="member-link">
<a name="contains-point" href="#contains-point"><tt><b>contains</b>(point)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item's geometry contains the given point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>point:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;The point to check for.

</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Click within and outside the star below Create a star shaped path:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-35">
var path = new Path.Star({
    center: [50, 50],
    points: 12,
    radius1: 20,
    radius2: 40,
    fillColor: 'black'
});

// Whenever the user presses the mouse:
function onMouseDown(event) {
    // If the position of the mouse is within the path,
    // set its fill color to red, otherwise set it to
    // black:
    if (path.contains(event.point)) {
        path.fillColor = 'red';
    } else {
        path.fillColor = 'black';
    }
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="hittest-point" class="member">
<div class="member-link">
<a name="hittest-point" href="#hittest-point"><tt><b>hitTest</b>(point[, options])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Perform a hit test on the item (and its children, if it is a
<a href="../classes/Group.html"><tt>Group</tt></a> or <a href="../classes/Layer.html"><tt>Layer</tt></a>) at the location of the specified point.</p>
<p>The options object allows you to control the specifics of the hit test
and may contain a combination of the following values:</p>
<p><b>options.tolerance:</b> <tt>Number</tt> – the tolerance of the hit test
in points. Can also be controlled through
<a href="../classes/Project.html#options"><tt>project.options</tt></a><tt>.hitTolerance</tt>.</p>
<p><b>options.class:</b> Only hit test again a certain item class and its
sub-classes: <tt>Group, Layer, Path, CompoundPath, Shape, Raster,
PlacedSymbol, PointText</tt>, etc.</p>
<p><b>options.fill:</b> <tt>Boolean</tt> – hit test the fill of items.</p>
<p><b>options.stroke:</b> <tt>Boolean</tt> – hit test the stroke of path
items, taking into account the setting of stroke color and width.</p>
<p><b>options.segments:</b> <tt>Boolean</tt> – hit test for
<a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items.</p>
<p><b>options.curves:</b> <tt>Boolean</tt> – hit test the curves of path
items, without taking the stroke color or width into account.</p>
<p><b>options.handles:</b> <tt>Boolean</tt> – hit test for the handles
(<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</p>
<p><b>options.ends:</b> <tt>Boolean</tt> – only hit test for the first or
last segment points of open path items.</p>
<p><b>options.bounds:</b> <tt>Boolean</tt> – hit test the corners and
side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.center:</b> <tt>Boolean</tt> – hit test the
<a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items
(<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>).</p>
<p><b>options.guides:</b> <tt>Boolean</tt> – hit test items that have
<tt>Item#guide</tt> set to <tt>true</tt>.</p>
<p><b>options.selected:</b> <tt>Boolean</tt> – only hit selected items.<b</p>
	
<ul><b>Parameters:</b>

<li>
<tt>point:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;The point where the hit test should be performed

</li>

<li>
<tt>options:</tt> 
<tt>Object</tt>

&mdash;&nbsp;optional, default: <tt>{ fill: true, stroke: true, segments: true,
tolerance: 2 }</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/HitResult.html"><tt>HitResult</tt></a></tt>&nbsp;&mdash;&nbsp;a hit result object that contains more
information about what exactly was hit or <tt>null</tt> if nothing was
hit
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Fetching and matching items</h3>

<div id="matches-match" class="member">
<div class="member-link">
<a name="matches-match" href="#matches-match"><tt><b>matches</b>(match)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Check whether the item matches the properties in the specified object.</p>
<p>Extended matching is possible by providing a compare function or
regular expression. Matching points, colors only work as a comparison
of the full object, not partial matching (e.g. only providing the x-
coordinate to match all points with that x-value). Partial matching
does work for <a href="../classes/Item.html#data"><tt>item.data</tt></a>.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>match:</tt> 
<tt>Object</tt>
&mdash;&nbsp;The criteria to match against.

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item matches the criteria, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	<p><b>See also:</b>
	<tt><a href="../classes/Project.html#getitems-match"><tt>project.getItems(match)</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="getitems-match" class="member">
<div class="member-link">
<a name="getitems-match" href="#getitems-match"><tt><b>getItems</b>(match)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Fetch the descendants (children or children of children) of this item
that match the properties in the specified object.</p>
<p>Extended matching is possible by providing a compare function or
regular expression. Matching points, colors only work as a comparison
of the full object, not partial matching (e.g. only providing the x-
coordinate to match all points with that x-value). Partial matching
does work for <a href="../classes/Item.html#data"><tt>item.data</tt></a>.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>match:</tt> 
<tt>Object</tt>
&mdash;&nbsp;The criteria to match against.

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>
</li>
	
	</ul>

	
	<p><b>See also:</b>
	<tt><a href="../classes/Project.html#getitems-match"><tt>project.getItems(match)</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="getitem-match" class="member">
<div class="member-link">
<a name="getitem-match" href="#getitem-match"><tt><b>getItem</b>(match)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Fetch the first descendant (child or child of child) of this item
that matches the properties in the specified object.</p>
<p>Extended matching is possible by providing a compare function or
regular expression. Matching points, colors only work as a comparison
of the full object, not partial matching (e.g. only providing the x-
coordinate to match all points with that x-value). Partial matching
does work for <a href="../classes/Item.html#data"><tt>item.data</tt></a>.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>match:</tt> 
<tt>Object</tt>
&mdash;&nbsp;The criteria to match against.

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>
</li>
	
	</ul>

	
	<p><b>See also:</b>
	<tt><a href="../classes/Project.html#getitem-match"><tt>project.getItem(match)</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<h3>Importing / Exporting JSON and SVG</h3>

<div id="exportjson" class="member">
<div class="member-link">
<a name="exportjson" href="#exportjson"><tt><b>exportJSON</b>([options])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Exports (serializes) the item with its content and child items to a JSON
data string.</p>
<p>The options object offers control over some aspects of the SVG export:</p>
<p><b>options.asString:</b> <tt>Boolean</tt> – whether the JSON is returned
as a <tt>Object</tt> or a <tt>String</tt>.</p>
<p><b>options.precision:</b> <tt>Number</tt> – the amount of fractional
digits in numbers used in JSON data.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>options:</tt> 
<tt>Object</tt>
&mdash;&nbsp;the
serialization options
&mdash;&nbsp;optional, default: <tt>{ asString: true, precision: 5 }</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;the exported JSON data
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="importjson-json" class="member">
<div class="member-link">
<a name="importjson-json" href="#importjson-json"><tt><b>importJSON</b>(json)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Imports (deserializes) the stored JSON data into this item. If the data
describes an item of the same class or a parent class of the item, the
data is imported into the item itself. If not, the imported item is added
to this item's <a href="../classes/Item.html#children"><tt>item.children</tt></a> list. Note that not all type of
items can have children.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>json:</tt> 
<tt>String</tt>
&mdash;&nbsp;the JSON data to import from.

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="exportsvg" class="member">
<div class="member-link">
<a name="exportsvg" href="#exportsvg"><tt><b>exportSVG</b>([options])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Exports the item with its content and child items as an SVG DOM.</p>
<p>The options object offers control over some aspects of the SVG export:</p>
<p><b>options.asString:</b> <tt>Boolean</tt> – whether a SVG node or a
<tt>String</tt> is to be returned.</p>
<p><b>options.precision:</b> <tt>Number</tt> – the amount of fractional
digits in numbers used in SVG data.</p>
<p><b>options.matchShapes:</b> <tt>Boolean</tt> – whether imported path
items should tried to be converted to shape items, if their geometries
match.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>options:</tt> 
<tt>Object</tt>
&mdash;&nbsp;the export options.
&mdash;&nbsp;optional, default: <tt>{ asString: false, precision: 5,
matchShapes: false }</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>SVGElement</tt></tt>&nbsp;&mdash;&nbsp;the item converted to an SVG node
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="importsvg-svg" class="member">
<div class="member-link">
<a name="importsvg-svg" href="#importsvg-svg"><tt><b>importSVG</b>(svg[, options])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Converts the provided SVG content into Paper.js items and adds them to
the this item's children list.</p>
<p>Note that the item is not cleared first. You can call
<a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>() to do so.</p>
<p>The options object offers control over some aspects of the SVG import:</p>
<p><b>options.expandShapes:</b> <tt>Boolean</tt> – whether imported shape
items should be expanded to path items.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>svg:</tt> 
<tt>SVGElement</tt> / <tt>String</tt>
&mdash;&nbsp;the SVG content to import

</li>

<li>
<tt>options:</tt> 
<tt>Object</tt>
&mdash;&nbsp;the import options
&mdash;&nbsp;optional, default: <tt>{ expandShapes: false }</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the imported Paper.js parent item
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Hierarchy Operations</h3>

<div id="addchild-item-_preserve" class="member">
<div class="member-link">
<a name="addchild-item-_preserve" href="#addchild-item-_preserve"><tt><b>addChild</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Adds the specified item as a child of this item at the end of the
its children list. You can use this function for groups, compound
paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item to be added as a child

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the added item, or <tt>null</tt> if adding was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="insertchild-index-item-_preserve" class="member">
<div class="member-link">
<a name="insertchild-index-item-_preserve" href="#insertchild-index-item-_preserve"><tt><b>insertChild</b>(index, item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts the specified item as a child of this item at the specified
index in its <a href="../classes/Item.html#children" onclick="return toggleMember('children', true);"><tt>children</tt></a> list. You can use this function for
groups, compound paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>index:</tt> 
<tt>Number</tt>


</li>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item to be inserted as a child

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted item, or <tt>null</tt> if inserting was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="addchildren-items-_preserve" class="member">
<div class="member-link">
<a name="addchildren-items-_preserve" href="#addchildren-items-_preserve"><tt><b>addChildren</b>(items)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Adds the specified items as children of this item at the end of the
its children list. You can use this function for groups, compound
paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>items:</tt> 
Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
&mdash;&nbsp;The items to be added as children

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the added items, or <tt>null</tt> if adding was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="insertchildren-index-items-_preserve-_proto" class="member">
<div class="member-link">
<a name="insertchildren-index-items-_preserve-_proto" href="#insertchildren-index-items-_preserve-_proto"><tt><b>insertChildren</b>(index, items)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts the specified items as children of this item at the specified
index in its <a href="../classes/Item.html#children" onclick="return toggleMember('children', true);"><tt>children</tt></a> list. You can use this function for
groups, compound paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>index:</tt> 
<tt>Number</tt>


</li>

<li>
<tt>items:</tt> 
Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
&mdash;&nbsp;The items to be appended as children

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the inserted items, or <tt>null</tt> if inserted was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="insertabove-item-_preserve" class="member">
<div class="member-link">
<a name="insertabove-item-_preserve" href="#insertabove-item-_preserve"><tt><b>insertAbove</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts this item above the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item above which it should be inserted

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted item, or <tt>null</tt> if inserting was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="insertbelow-item-_preserve" class="member">
<div class="member-link">
<a name="insertbelow-item-_preserve" href="#insertbelow-item-_preserve"><tt><b>insertBelow</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts this item below the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item below which it should be inserted

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted item, or <tt>null</tt> if inserting was not
possible.
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="sendtoback" class="member">
<div class="member-link">
<a name="sendtoback" href="#sendtoback"><tt><b>sendToBack</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Sends this item to the back of all other items within the same parent.</p>
	
	
	
	
</div>
</div>
</div>

	
<div id="bringtofront" class="member">
<div class="member-link">
<a name="bringtofront" href="#bringtofront"><tt><b>bringToFront</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Brings this item to the front of all other items within the same parent.</p>
	
	
	
	
</div>
</div>
</div>

	
<div id="appendtop-item" class="member">
<div class="member-link">
<a name="appendtop-item" href="#appendtop-item"><tt><b>appendTop</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts the specified item as a child of this item by appending it to
the list of children and moving it above all other children. You can
use this function for groups, compound paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to be appended as a child

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="appendbottom-item" class="member">
<div class="member-link">
<a name="appendbottom-item" href="#appendbottom-item"><tt><b>appendBottom</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Inserts the specified item as a child of this item by appending it to
the list of children and moving it below all other children. You can
use this function for groups, compound paths and layers.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to be appended as a child

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="moveabove-item" class="member">
<div class="member-link">
<a name="moveabove-item" href="#moveabove-item"><tt><b>moveAbove</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Moves this item above the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item above which it should be moved

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it was moved, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="movebelow-item" class="member">
<div class="member-link">
<a name="movebelow-item" href="#movebelow-item"><tt><b>moveBelow</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Moves the item below the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item below which it should be moved

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it was moved, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="reduce" class="member">
<div class="member-link">
<a name="reduce" href="#reduce"><tt><b>reduce</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>If this is a group, layer or compound-path with only one child-item,
the child-item is moved outside and the parent is erased. Otherwise, the
item itself is returned unmodified.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the reduced item
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="remove" class="member">
<div class="member-link">
<a name="remove" href="#remove"><tt><b>remove</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item from the project. If the item has children, they are also
removed.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item was removed, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="removechildren" class="member">
<div class="member-link">
<a name="removechildren" href="#removechildren"><tt><b>removeChildren</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes all of the item's <a href="../classes/Item.html#children" onclick="return toggleMember('children', true);"><tt>children</tt></a> (if any).</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;an array containing the removed items
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="removechildren-from" class="member">
<div class="member-link">
<a name="removechildren-from" href="#removechildren-from"><tt><b>removeChildren</b>(from[, to])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the children from the specified <tt>from</tt> index to the
<tt>to</tt> index from the parent's <a href="../classes/Item.html#children" onclick="return toggleMember('children', true);"><tt>children</tt></a> array.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>from:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the beginning index, inclusive

</li>

<li>
<tt>to:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the ending index, exclusive
&mdash;&nbsp;optional, default: <tt>children.length</tt>
</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;an array containing the removed items
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="reversechildren" class="member">
<div class="member-link">
<a name="reversechildren" href="#reversechildren"><tt><b>reverseChildren</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Reverses the order of the item's children</p>
	
	
	
	
</div>
</div>
</div>

	
<h3>Tests</h3>

<div id="isempty" class="member">
<div class="member-link">
<a name="isempty" href="#isempty"><tt><b>isEmpty</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Specifies whether the item has any content or not. The meaning of what
content is differs from type to type. For example, a <a href="../classes/Group.html"><tt>Group</tt></a> with
no children, a <a href="../classes/TextItem.html"><tt>TextItem</tt></a> with no text content and a <a href="../classes/Path.html"><tt>Path</tt></a>
with no segments all are considered empty.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt></tt>&nbsp;&mdash;&nbsp;Boolean
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Style Tests</h3>

<div id="hasfill" class="member">
<div class="member-link">
<a name="hasfill" href="#hasfill"><tt><b>hasFill</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item has a fill.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a fill, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="hasstroke" class="member">
<div class="member-link">
<a name="hasstroke" href="#hasstroke"><tt><b>hasStroke</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item has a stroke.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a stroke, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="hasshadow" class="member">
<div class="member-link">
<a name="hasshadow" href="#hasshadow"><tt><b>hasShadow</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item has a shadow.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a shadow, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Hierarchy Tests</h3>

<div id="haschildren" class="member">
<div class="member-link">
<a name="haschildren" href="#haschildren"><tt><b>hasChildren</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks if the item contains any children items.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> it has one or more children, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isinserted" class="member">
<div class="member-link">
<a name="isinserted" href="#isinserted"><tt><b>isInserted</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item and all its parents are inserted into the DOM or
not.</p>
	
	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item is inserted into the DOM, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isabove-item" class="member">
<div class="member-link">
<a name="isabove-item" href="#isabove-item"><tt><b>isAbove</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks if this item is above the specified item in the stacking order
of the project.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it is above the specified item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isbelow-item" class="member">
<div class="member-link">
<a name="isbelow-item" href="#isbelow-item"><tt><b>isBelow</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks if the item is below the specified item in the stacking order of
the project.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it is below the specified item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isparent-item" class="member">
<div class="member-link">
<a name="isparent-item" href="#isparent-item"><tt><b>isParent</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the specified item is the parent of the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it is the parent of the item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="ischild-item" class="member">
<div class="member-link">
<a name="ischild-item" href="#ischild-item"><tt><b>isChild</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the specified item is a child of the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> it is a child of the item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isdescendant-item" class="member">
<div class="member-link">
<a name="isdescendant-item" href="#isdescendant-item"><tt><b>isDescendant</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks if the item is contained within the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;The item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it is inside the specified item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isancestor-item" class="member">
<div class="member-link">
<a name="isancestor-item" href="#isancestor-item"><tt><b>isAncestor</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks if the item is an ancestor of the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>
&mdash;&nbsp;the item to check against

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item is an ancestor of the specified
item, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="isgroupedwith-item" class="member">
<div class="member-link">
<a name="isgroupedwith-item" href="#isgroupedwith-item"><tt><b>isGroupedWith</b>(item)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Checks whether the item is grouped with the specified item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>item:</tt> 
<a href="../classes/Item.html"><tt>Item</tt></a>


</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the items are grouped together, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Transform Functions</h3>

<div id="translate-delta" class="member">
<div class="member-link">
<a name="translate-delta" href="#translate-delta"><tt><b>translate</b>(delta)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Translates (moves) the item by the given offset point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>delta:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;the offset to translate the item by

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="rotate-angle" class="member">
<div class="member-link">
<a name="rotate-angle" href="#rotate-angle"><tt><b>rotate</b>(angle[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Rotates the item by a given angle around the given point.</p>
<p>Angles are oriented clockwise and measured in degrees.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>angle:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the rotation angle

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p><b>See also:</b>
	<tt><a href="../classes/Matrix.html#rotate"><tt>matrix.rotate</tt></a></tt>
	</p>

	<p>
<b>Example</b> &mdash; Rotating an item:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-36">
// Create a rectangle shaped path with its top left
// point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
path.fillColor = 'black';

// Rotate the path by 30 degrees:
path.rotate(30);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Rotating an item around a specific point:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-37">
// Create a rectangle shaped path with its top left
// point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
var topLeft = new Point(175, 50);
var size = new Size(100, 100);
var path = new Path.Rectangle(topLeft, size);
path.fillColor = 'black';

// Draw a circle shaped path in the center of the view,
// to show the rotation point:
var circle = new Path.Circle({
    center: view.center,
    radius: 5,
    fillColor: 'white'
});

// Each frame rotate the path 3 degrees around the center point
// of the view:
function onFrame(event) {
    path.rotate(3, view.center);
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-37"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="scale-scale" class="member">
<div class="member-link">
<a name="scale-scale" href="#scale-scale"><tt><b>scale</b>(scale[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Scales the item by the given value from its center point, or optionally
from a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>scale:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the scale factor

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Scaling an item from its center point:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-38">
// Create a circle shaped path at { x: 80, y: 50 }
// with a radius of 20:
var circle = new Path.Circle({
    center: [80, 50],
    radius: 20,
    fillColor: 'red'
});

// Scale the path by 150% from its center point
circle.scale(1.5);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Scaling an item from a specific point:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-39">
// Create a circle shaped path at { x: 80, y: 50 }
// with a radius of 20:
var circle = new Path.Circle({
    center: [80, 50],
    radius: 20,
    fillColor: 'red'
});

// Scale the path 150% from its bottom left corner
circle.scale(1.5, circle.bounds.bottomLeft);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="scale-hor-ver" class="member">
<div class="member-link">
<a name="scale-hor-ver" href="#scale-hor-ver"><tt><b>scale</b>(hor, ver[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Scales the item by the given values from its center point, or optionally
from a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>hor:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the horizontal scale factor

</li>

<li>
<tt>ver:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the vertical scale factor

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Scaling an item horizontally by 300%:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-40">
// Create a circle shaped path at { x: 100, y: 50 }
// with a radius of 20:
var circle = new Path.Circle({
    center: [100, 50],
    radius: 20,
    fillColor: 'red'
});

// Scale the path horizontally by 300%
circle.scale(3, 1);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="shear-shear" class="member">
<div class="member-link">
<a name="shear-shear" href="#shear-shear"><tt><b>shear</b>(shear[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Shears the item by the given value from its center point, or optionally
by a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>shear:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;the horziontal and vertical shear factors as a point

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p><b>See also:</b>
	<tt><a href="../classes/Matrix.html#shear"><tt>matrix.shear</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="shear-hor-ver" class="member">
<div class="member-link">
<a name="shear-hor-ver" href="#shear-hor-ver"><tt><b>shear</b>(hor, ver[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Shears the item by the given values from its center point, or optionally
by a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>hor:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the horizontal shear factor

</li>

<li>
<tt>ver:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the vertical shear factor

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p><b>See also:</b>
	<tt><a href="../classes/Matrix.html#shear"><tt>matrix.shear</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="skew-skew" class="member">
<div class="member-link">
<a name="skew-skew" href="#skew-skew"><tt><b>skew</b>(skew[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Skews the item by the given angles from its center point, or optionally
by a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>skew:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;the horziontal and vertical skew angles in degrees

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p><b>See also:</b>
	<tt><a href="../classes/Matrix.html#shear"><tt>matrix.shear</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="skew-hor-ver" class="member">
<div class="member-link">
<a name="skew-hor-ver" href="#skew-hor-ver"><tt><b>skew</b>(hor, ver[, center])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Skews the item by the given angles from its center point, or optionally
by a supplied point.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>hor:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the horizontal skew angle in degrees

</li>

<li>
<tt>ver:</tt> 
<tt>Number</tt>
&mdash;&nbsp;the vertical sskew angle in degrees

</li>

<li>
<tt>center:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>

&mdash;&nbsp;optional, default: <tt><a href="../classes/Item.html#position"><tt>item.position</tt></a></tt>
</li>

</ul>

	
	
	<p><b>See also:</b>
	<tt><a href="../classes/Matrix.html#shear"><tt>matrix.shear</tt></a></tt>
	</p>

	
</div>
</div>
</div>

	
<div id="transform-matrix-_applyMatrix" class="member">
<div class="member-link">
<a name="transform-matrix-_applyMatrix" href="#transform-matrix-_applyMatrix"><tt><b>transform</b>(matrix)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Transform the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>matrix:</tt> 
<a href="../classes/Matrix.html"><tt>Matrix</tt></a>
&mdash;&nbsp;the matrix by which the item shall be transformed.

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="globaltolocal-point" class="member">
<div class="member-link">
<a name="globaltolocal-point" href="#globaltolocal-point"><tt><b>globalToLocal</b>(point)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Converts the specified point from global project coordinates to local
coordinates in relation to the the item's own coordinate space.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>point:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;the point to be transformed

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the transformed point as a new instance
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="localtoglobal-point" class="member">
<div class="member-link">
<a name="localtoglobal-point" href="#localtoglobal-point"><tt><b>localToGlobal</b>(point)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Converts the specified point from local coordinates to global coordinates
in relation to the the project coordinate space.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>point:</tt> 
<a href="../classes/Point.html"><tt>Point</tt></a>
&mdash;&nbsp;the point to be transformed

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the transformed point as a new instance
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<div id="fitbounds-rectangle" class="member">
<div class="member-link">
<a name="fitbounds-rectangle" href="#fitbounds-rectangle"><tt><b>fitBounds</b>(rectangle[, fill])</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Transform the item so that its <a href="../classes/Item.html#bounds" onclick="return toggleMember('bounds', true);"><tt>bounds</tt></a> fit within the specified
rectangle, without changing its aspect ratio.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>rectangle:</tt> 
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>


</li>

<li>
<tt>fill:</tt> 
<tt>Boolean</tt>

&mdash;&nbsp;optional, default: <tt>false</tt>
</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Fitting an item to the bounding rectangle of another item's bounding rectangle:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-41">
// Create a rectangle shaped path with its top left corner
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
var path = new Path.Rectangle({
    point: [80, 25],
    size: [75, 50],
    fillColor: 'black'
});

// Create a circle shaped path with its center at {x: 80, y: 50}
// and a radius of 30.
var circlePath = new Path.Circle({
    center: [80, 50],
    radius: 30,
    fillColor: 'red'
});

// Fit the circlePath to the bounding rectangle of
// the rectangular path:
circlePath.fitBounds(path.bounds);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Fitting an item to the bounding rectangle of another item's bounding rectangle with the fill parameter set to true:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-42">
// Create a rectangle shaped path with its top left corner
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
var path = new Path.Rectangle({
    point: [80, 25],
    size: [75, 50],
    fillColor: 'black'
});

// Create a circle shaped path with its center at {x: 80, y: 50}
// and a radius of 30.
var circlePath = new Path.Circle({
    center: [80, 50],
    radius: 30,
    fillColor: 'red'
});

// Fit the circlePath to the bounding rectangle of
// the rectangular path:
circlePath.fitBounds(path.bounds, true);
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; Fitting an item to the bounding rectangle of the view
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-43">
var path = new Path.Circle({
    center: [80, 50],
    radius: 30,
    fillColor: 'red'
});

// Fit the path to the bounding rectangle of the view:
path.fitBounds(view.bounds);
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-43"></canvas></div>
</div>


</div>
</div>
</div>

	
<h3>Event Handling</h3>

<div id="attach-type-function" class="member">
<div class="member-link">
<a name="attach-type-function" href="#attach-type-function"><tt><b>attach</b>(type, function)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Attaches an event handler to the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>type:</tt> 
<tt>String('mousedown'|'mouseup'|'mousedrag'|'click'|'doubleclick'|'mousemove'|'mouseenter'|'mouseleave')</tt>
&mdash;&nbsp;the event
type

</li>

<li>
<tt>function:</tt> 
<tt>Function</tt>
&mdash;&nbsp;The function to be called when the event
occurs

</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Change the fill color of the path to red when the mouse enters its shape and back to black again, when it leaves its shape.
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-44">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25,
    fillColor: 'black'
});

// When the mouse enters the item, set its fill color to red:
path.on('mouseenter', function() {
    this.fillColor = 'red';
});

// When the mouse leaves the item, set its fill color to black:
path.on('mouseleave', function() {
    this.fillColor = 'black';
});
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="attach-object" class="member">
<div class="member-link">
<a name="attach-object" href="#attach-object"><tt><b>attach</b>(object)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Attaches one or more event handlers to the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>object:</tt> 
<tt>Object</tt>
&mdash;&nbsp;an object literal containing one or more of the
following properties: <tt>mousedown, mouseup, mousedrag, click,
doubleclick, mousemove, mouseenter, mouseleave</tt>.

</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Change the fill color of the path to red when the mouse enters its shape and back to black again, when it leaves its shape.
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-45">
// Create a circle shaped path at the center of the view:
var path = new Path.Circle({
    center: view.center,
    radius: 25
});
path.fillColor = 'black';

// When the mouse enters the item, set its fill color to red:
path.on({
    mouseenter: function(event) {
        this.fillColor = 'red';
    },
    mouseleave: function(event) {
        this.fillColor = 'black';
    }
});
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
</div>


<p>
<b>Example</b> &mdash; When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set black.
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-46">
var pathHandlers = {
    mouseenter: function(event) {
        this.fillColor = 'red';
    },
    mouseleave: function(event) {
        this.fillColor = 'black';
    }
}

// When the mouse is pressed:
function onMouseDown(event) {
    // Create a circle shaped path at the position of the mouse:
    var path = new Path.Circle({
        center: event.point,
        radius: 25,
        fillColor: 'black'
    });

    // Attach the handers inside the object literal to the path:
    path.on(pathHandlers);
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="detach-type-function" class="member">
<div class="member-link">
<a name="detach-type-function" href="#detach-type-function"><tt><b>detach</b>(type, function)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Detach an event handler from the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>type:</tt> 
<tt>String('mousedown'|'mouseup'|'mousedrag'|'click'|'doubleclick'|'mousemove'|'mouseenter'|'mouseleave')</tt>
&mdash;&nbsp;the event
type

</li>

<li>
<tt>function:</tt> 
<tt>Function</tt>
&mdash;&nbsp;The function to be detached

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="detach-object" class="member">
<div class="member-link">
<a name="detach-object" href="#detach-object"><tt><b>detach</b>(object)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Detach one or more event handlers to the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>object:</tt> 
<tt>Object</tt>
&mdash;&nbsp;an object literal containing one or more of the
following properties: <tt>mousedown, mouseup, mousedrag, click,
doubleclick, mousemove, mouseenter, mouseleave</tt>

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="fire-type-event" class="member">
<div class="member-link">
<a name="fire-type-event" href="#fire-type-event"><tt><b>fire</b>(type, event)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Fire an event on the item.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>type:</tt> 
<tt>String('mousedown'|'mouseup'|'mousedrag'|'click'|'doubleclick'|'mousemove'|'mouseenter'|'mouseleave')</tt>
&mdash;&nbsp;the event
type

</li>

<li>
<tt>event:</tt> 
<tt>Object</tt>
&mdash;&nbsp;an object literal containing properties describing
the event.

</li>

</ul>

	
	
	
</div>
</div>
</div>

	
<div id="responds-type" class="member">
<div class="member-link">
<a name="responds-type" href="#responds-type"><tt><b>responds</b>(type)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Check if the item has one or more event handlers of the specified type.</p>
	
<ul><b>Parameters:</b>

<li>
<tt>type:</tt> 
<tt>String('mousedown'|'mouseup'|'mousedrag'|'click'|'doubleclick'|'mousemove'|'mouseenter'|'mouseleave')</tt>
&mdash;&nbsp;the event
type

</li>

</ul>

	
	<ul><b>Returns:</b>
	
		<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has one or more event handlers of
the specified type, <tt>false</tt> otherwise
</li>
	
	</ul>

	
	
</div>
</div>
</div>

	
<h3>Remove On Event</h3>

<div id="removeon-object" class="member">
<div class="member-link">
<a name="removeon-object" href="#removeon-object"><tt><b>removeOn</b>(object)</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item when the events specified in the passed object literal
occur.</p>
<p>The object literal can contain the following values:</p>
<p>Remove the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is
fired: <tt>object.move = true</tt></p>
<p>Remove the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is
fired: <tt>object.drag = true</tt></p>
<p>Remove the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is
fired: <tt>object.down = true</tt></p>
<p>Remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is
fired: <tt>object.up = true</tt></p>
	
<ul><b>Parameters:</b>

<li>
<tt>object:</tt> 
<tt>Object</tt>


</li>

</ul>

	
	
	<p>
<b>Example</b> &mdash; Click and drag below:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-47">
function onMouseDrag(event) {
    // Create a circle shaped path at the mouse position,
    // with a radius of 10:
    var path = new Path.Circle({
        center: event.point,
        radius: 10,
        fillColor: 'black'
    });

    // Remove the path on the next onMouseDrag or onMouseDown event:
    path.removeOn({
        drag: true,
        down: true
    });
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-47"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="removeonmove" class="member">
<div class="member-link">
<a name="removeonmove" href="#removeonmove"><tt><b>removeOnMove</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is fired.</p>
	
	
	
	<p>
<b>Example</b> &mdash; Move your mouse below:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-48">
function onMouseMove(event) {
    // Create a circle shaped path at the mouse position,
    // with a radius of 10:
    var path = new Path.Circle({
        center: event.point,
        radius: 10,
        fillColor: 'black'
    });

    // On the next move event, automatically remove the path:
    path.removeOnMove();
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-48"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="removeondown" class="member">
<div class="member-link">
<a name="removeondown" href="#removeondown"><tt><b>removeOnDown</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is fired.</p>
	
	
	
	<p>
<b>Example</b> &mdash; Click a few times below:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-49">
function onMouseDown(event) {
    // Create a circle shaped path at the mouse position,
    // with a radius of 10:
    var path = new Path.Circle({
        center: event.point,
        radius: 10,
        fillColor: 'black'
    });

    // Remove the path, next time the mouse is pressed:
    path.removeOnDown();
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-49"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="removeondrag" class="member">
<div class="member-link">
<a name="removeondrag" href="#removeondrag"><tt><b>removeOnDrag</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is fired.</p>
	
	
	
	<p>
<b>Example</b> &mdash; Click and drag below:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-50">
function onMouseDrag(event) {
    // Create a circle shaped path at the mouse position,
    // with a radius of 10:
    var path = new Path.Circle({
        center: event.point,
        radius: 10,
        fillColor: 'black'
    });

    // On the next drag event, automatically remove the path:
    path.removeOnDrag();
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-50"></canvas></div>
</div>


</div>
</div>
</div>

	
<div id="removeonup" class="member">
<div class="member-link">
<a name="removeonup" href="#removeonup"><tt><b>removeOnUp</b>()</tt></a>
</div>
<div class="member-description hidden">
<div class="member-text">
	<p>Removes the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</p>
	
	
	
	<p>
<b>Example</b> &mdash; Click a few times below:
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-51">
function onMouseDown(event) {
    // Create a circle shaped path at the mouse position,
    // with a radius of 10:
    var path = new Path.Circle({
        center: event.point,
        radius: 10,
        fillColor: 'black'
    });

    // Remove the path, when the mouse is released:
    path.removeOnUp();
}
</script>
<div class="canvas"><canvas width="516" height="200" id="canvas-51"></canvas></div>
</div>


</div>
</div>
</div>

</div>



<!-- =========================== inherited properties ====================== -->
<div class="reference-members"><h2>Properties inherited from <a href="../classes/Group.html"><tt>Group</tt></a></h2>

	
<div id="clipped" class="member">
<div class="member-link">
<a name="clipped" href="#clipped"><tt><b>clipped</b></tt></a>
</div>
<div class="member-description hidden">

<div class="member-text">
	<p>Specifies whether the group item is to be clipped.</p>
<p>When setting to <tt>true</tt>, the first child in the group is
automatically defined as the clipping mask.</p>
	
	
	<ul><b>Type:</b>
	<li>
		<tt>Boolean</tt>
	</li>
	</ul>
	
	<p>
<b>Example</b> 
</p>

<div class="paperscript split">

<div class="buttons">
<div class="button run">Run</div>
</div>

<script type="text/paperscript" canvas="canvas-52">
var star = new Path.Star({
    center: view.center,
    points: 6,
    radius1: 20,
    radius2: 40,
    fillColor: 'red'
});

var circle = new Path.Circle({
    center: view.center,
    radius: 25,
    strokeColor: 'black'
});

// Create a group of the two items and clip it:
var group = new Group(circle, star);
group.clipped = true;

// Lets animate the circle:
function onFrame(event) {
    var offset = Math.sin(event.count / 30) * 30;
    circle.position.x = view.center.x + offset;
}
</script>
<div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
</div>


</div>

</div>
</div>

</div>




<!-- =========================== copyright notice ========================= -->
<p class="footer">Copyright &#169; 2011 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
<div class="content-end"></div>

</body>